{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">信息管理</li>
            <li class=""><a href="{:url('admin/StoreTruck/add')}">添加信息</a></li>
        </ul>
        <div class="layui-tab-content">

            <form class="layui-form layui-form-pane" action="{:url('admin/StoreTruck/index')}" method="get">

                <div class="layui-inline" style="margin-bottom: 5px;">
                    <label class="layui-form-label" style="min-width:50px;">车型</label>
                    <div class="layui-input-inline" style="width:160px;">
                        <select name="type">
                            <option value="0">全部</option>
                            {foreach name="store_list" item="vo"}
                            {if $vo.pid == 3}
                            <option value="{$vo.id}">{$vo.name}</option>
                            {/if}
                            {/foreach}
                        </select>
                    </div>
                </div>
                <div class="layui-inline" style="margin-bottom: 5px;">
                    <label class="layui-form-label" style="min-width:50px;">品牌</label>
                    <div class="layui-input-inline" style="width:160px;">
                        <select name="brand">
                            <option value="0">全部</option>
                            {foreach name="store_list" item="vo"}
                            {if $vo.pid == 1}
                            <option value="{$vo.id}">{$vo.name}</option>
                            {/if}
                            {/foreach}
                        </select>
                    </div>
                </div>
                <div class="layui-inline" style="margin-bottom: 5px;">
                    <label class="layui-form-label" style="min-width:50px;">驱动</label>
                    <div class="layui-input-inline" style="width:160px;">
                        <select name="drive">
                            <option value="0">全部</option>
                            {foreach name="store_list" item="vo"}
                            {if $vo.pid == 4}
                            <option value="{$vo.id}">{$vo.name}</option>
                            {/if}
                            {/foreach}
                        </select>
                    </div>
                </div>
                <div class="layui-inline" style="margin-bottom: 5px;">
                    <label class="layui-form-label" style="min-width:50px;">标题</label>
                    <div class="layui-input-inline">
                        <input type="text" name="title" value="{$title}" placeholder="请输入标题关键词" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline"  style="margin-bottom: 5px;">
                    <button class="layui-btn">搜索</button>
                </div>
            </form>
            <hr>

            <form action="" method="post" class="ajax-form">
                <button type="button" class="layui-btn layui-btn-small ajax-action" data-action="{:url('admin/StoreTruck/toggle',['type'=>'audit'])}">审核</button>
                <button type="button" class="layui-btn layui-btn-warm layui-btn-small ajax-action" data-action="{:url('admin/StoreTruck/toggle',['type'=>'cancel_audit'])}">取消审核</button>
                <button type="button" class="layui-btn layui-btn-danger layui-btn-small ajax-action" data-action="{:url('admin/StoreTruck/delete')}">删除</button>
                <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th style="width: 15px;"><input type="checkbox" class="check-all"></th>
                            <th style="width: 30px;">ID</th>
                            <th>标题</th>
                            <th>车型</th>
                            <th>品牌</th>
                            <th>驱动</th>
                            <th>马力</th>
                            <th>价格</th>
                            <th>发布时间</th>
                            <th>查看(次)</th>
                            <th>审核</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach name="storetruck_list" item="vo"}
                        <tr>
                            <td><input type="checkbox" name="ids[]" value="{$vo.id}"></td>
                            <td>{$vo.id}</td>
                            <td>{$vo.title}</td>
                            <td>{$store_classify[$vo['type']]}</td>
                            <td>{$store_classify[$vo['brand']]}</td>
                            <td>{$store_classify[$vo['drive']]}</td>
                            <td>{$vo.soup}</td>
                            <td>{$vo.price}</td>
                            <td>{$vo.create_time}</td>
                            <td>{$vo.reading}</td>
                            <td>
                            {if $vo.status==1}
                                    <i style="font-style: normal;color:#4caf50;">已审核</i>
                                {else /}
                                    <button type="button" class="layui-btn layui-btn-small ajax-action layui-btn-mini" data-action="{:url('admin/StoreTruck/toggle',['type'=>'audit','id'=>$vo['id']])}">审核</button>
                                {/if}
                            </td>
                            <td>
                                <a href="{:url('admin/StoreTruck/reading',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-mini">查看</a>
                                <a href="{:url('admin/StoreTruck/edit',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
                                <a href="{:url('admin/StoreTruck/delete',['id'=>$vo['id']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除</a>
                            </td>
                        </tr>
                        {/foreach}
                        </tbody>
                    </table>
                    <!--分页-->
                    {$storetruck_list->render()}
                </div>
            </form>
        </div>
    </div>
</div>
{/block}